<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Vec3 (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">math.Vec3</span>
        <span>Extends</span>
        <span class="fn-name">
          <a href="class_goog_math_Coordinate3.html">
            goog.math.Coordinate3</a>
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Class for a three-dimensional vector object and assorted functions useful for
manipulation.

Inherits from goog.math.Coordinate3 so that a Vec3 may be passed in to any
function that requires a Coordinate.
  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_math_vec3.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<pre class="inheritance">
Object
     <img src="static/images/inherit.gif"><span class="type"><a href="class_goog_math_Coordinate3.html">goog.math.Coordinate3</a></span>
          <img src="static/images/inherit.gif">goog.math.Vec3
</pre>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.math.Vec3(<span><span class="arg">opt_x</span>,&nbsp;<span class="arg">opt_y</span>,&nbsp;<span class="arg">opt_z</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_x</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The x value for the vector.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_y</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The y value for the vector.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_z</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The z value for the vector.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Vec3.html">
              goog.math.Vec3
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.add"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">add<span class="args">(<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Adds another vector to this vector in-place.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The vector to add.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            This vector with {@code b} added.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line179">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.clone"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">clone<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Creates a new copy of this Vec3.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            A new vector with the same coordinates as this one.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line109">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.equals"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">equals<span class="args">(<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Compares this vector with another for equality.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The other vector.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            True if this vector&#39;s x, y and z equal the given vector&#39;s x, y, and z, respectively.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line208">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.invert"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">invert<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Reverses the sign of the vector. Equivalent to scaling the vector by -1.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            This vector, inverted.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line155">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.magnitude"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">magnitude<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the magnitude of the vector measured from the origin.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The length of the vector.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line119">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.normalize"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">normalize<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Normalizes the current vector to have a magnitude of 1.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            This vector, normalized.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line168">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.scale"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">scale<span class="args">(<span class="arg">s</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Scales the current vector by a constant.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">s</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The scale factor.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            This vector, scaled.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line142">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.squaredMagnitude"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">squaredMagnitude<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the squared magnitude of the vector measured from the origin.
NOTE: Leaving out the square root is not a significant
optimization in JavaScript.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The length of the vector, squared.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line131">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.prototype.subtract"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">subtract<span class="args">(<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Subtracts another vector from this vector in-place.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The vector to subtract.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            This vector with {@code b} subtracted.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line193">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>

<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Coordinate3.html">
              goog.math.Coordinate3
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate3.prototype.clone"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">clone<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Coordinate3.html">goog.math.Coordinate3</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a new copy of the coordinate.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Coordinate3.html">goog.math.Coordinate3</a></span></div>&nbsp;
            A clone of this coordinate.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_coordinate3.js.source.html#line58">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate3.prototype.toArray"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">toArray<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
      </div>


     <div class="entryOverview">
       Returns the contents of this coordinate as a 3 value Array.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></span>.&lt;<span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>&nbsp;
            A new array.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_coordinate3.js.source.html#line147">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate3.prototype.toString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">toString<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a nice string representing the coordinate.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            In the form (50, 73, 31).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_coordinate3.js.source.html#line69">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>














<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.cross"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">cross<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the cross-product of two vectors.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The first vector.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The second vector.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            The cross-product of the two vectors.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line305">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.difference"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">difference<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the difference of two vectors as a new Vec3.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The first vector.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The second vector.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            The difference vector.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line281">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.distance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">distance<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the distance between two vectors.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The distance.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line220">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.dot"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">dot<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the dot-product of two vectors.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The first vector.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The second vector.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The dot-product of the two vectors.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line293">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.equals"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">equals<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Compares vectors for equality.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            True if the vectors have equal x, y, and z coordinates.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line259">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.fromCoordinate3"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">fromCoordinate3<span class="args">(<span class="arg">a</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a new Vec3 object from a given coordinate.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Coordinate3.html">goog.math.Coordinate3</a></span></div>
        <div class="entryOverview">The coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            A new vector object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line99">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.lerp"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">lerp<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>,&nbsp;<span class="arg">x</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a new Vec3 that is the linear interpolant between vectors a and b at
scale-value x.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">Vector a.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">Vector b.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">x</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
        <div class="entryOverview">The proportion between a and b.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            The interpolated vector.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line321">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.random"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">random<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Generates a random vector inside the unit sphere.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            A random vector.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line88">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.randomUnit"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">randomUnit<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Generates a random unit vector.

<a href="http://mathworld.wolfram.com/SpherePointPicking.html">http://mathworld.wolfram.com/SpherePointPicking.html</a>
Using (6), (7), and (8) to generate coordinates.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            A random unit-length vector.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line71">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.squaredDistance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">squaredDistance<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the squared distance between two vectors.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>&nbsp;
            The squared distance.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line230">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.sum"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">sum<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the sum of two vectors as a new Vec3.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The first vector.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>
        <div class="entryOverview">The second vector.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Vec3.html">goog.math.Vec3</a></span></div>&nbsp;
            The sum vector.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line269">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.toMatrix3x1"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">toMatrix3x1<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a new 3x1 matrix object from a given coordinate.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span></div>&nbsp;
            A new matrix object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line239">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Vec3.toMatrix4x1"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Vec3.</span><span class="entryName">toMatrix4x1<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a new 4x1 matrix object from a given coordinate.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="class_goog_math_Matrix.html">goog.math.Matrix</a></span></div>&nbsp;
            A new matrix object.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_math_vec3.js.source.html#line249">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package math</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="goog" current="math.Vec3"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
